{% extends "layout.html" %}                #通过这句话，来进行继承挂钩，和主体base.html进行链接
{% block content %}
<style type="text/css">
	.field-item::after{content:'';height: 0;clear: both;visibility: none;display: block;zoom: 1;}
	.field-item{margin: 10px 0;}
	.field-item > div{line-height: 38px;}
	.layui-form{max-width: 900px;margin: 0 auto;}
	.diabled{background-color: #ddd;}
	.wrap{padding-top: 50px;}
	.layui-form-label{width: auto;}
</style>
<link rel="stylesheet" type="text/css" href="https://d3s6yopk5rlhed.cloudfront.net/static/css/jquery.ui.css">
<div>
	<div class="wrap">
		<form class="layui-form">
			<p>Terms and conditions sheet for credit checking</p>
			<div style="margin: 10px 0;padding: 5px;overflow: auto;">
				<p style="white-space: pre-wrap;">
Radiance Mortgage Inc. ("Radiance", "we", "us" and "our"), in accordance with our privacy policy and our obligations at law, may collect, receive, retain, use and disclose personal information about you, our client, for the purpose of: verification assessing credit-worthiness; establishing credit limits; maintaining client relationships; presenting your mortgage application to various lenders and insurers and providing information to you about other products and services that may be of interest to you. We may also disclose your personal information to (i) any potential purchaser of our business and their advisors. (ii) Any third party service providers to whom we may outsource our business functions and (iii) any parties involved in the securitization, assignment or pledge of a loan or mortgage that are obtained through us.

By signing this form, you are providing your acknowledgement and express consent to Radiance and our agent:\
</p>
<p style="white-space: pre-wrap;padding-left: 25px;">
1.	to collect, use, retain and disclose your personal information for seven (7) years following the later of a) the date of your latest application with us, or b) the date on which your loans or mortgages we have arranged for you have expired or been terminated;
2.	to inquire about and receive your personal information from: consumer reporting agencies, credit bureaus, real estate appraisers, your bank(s) or other financial institutions with whom you deal, your past mortgage brokers, your present and past employers and other third parties who may have information about your financial status;
3.	that the approval or granting of any mortgage by a lender to you, as arranged by Radiance, is not to be construed or relied on by you as representing the value or condition of any underlying security or representing that you have the ability to repay the arranged mortgage debt;
4.	to receive commercial electronic messages and other forms of business information, communications and marketing regarding products and services that may be of interest to you;
5.	That Radiance and our agent may receive fees or incentives from a lender for arranging a mortgage or loan for you. Fees and incentives include but are not limited to money, points or goods and services. Fees and incentives may vary between lenders for similar products and may also be dependent on the amounts and types of mortgage products originated.
6.	That Radiance and our agent have not provided you with any investment advice or services and have advised you of the need for independent financial and tax planning advice from a qualified professional.
				</p>
			</div>
			<div class="layui-form-item">
			  <label class="layui-form-label">Do you accept the terms and conditions stated above?</label>
			    <input type="radio" name="is_accept" value="1" title="Yes">
			    <input type="radio" name="is_accept" value="0" title="No" checked>
			</div>
			<div id="isAccept-wrap" style="width: 90%;height: 30px;padding-top: 0px;padding-left: 12px;color: red;"></div>
			<div class="layui-form-item tc button-wrap" style="margin-top: 10px;">
			  	<span style=" width: 40%;" type="button" class="layui-btn layui-btn-primary" onclick="submit()">Submit</span>
			    <!-- <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
			    <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
			</div>
		</form>
	</div>
</div>
<script type="text/javascript" src="https://d3s6yopk5rlhed.cloudfront.net/static/js/jquery.min.js"></script>
<script type="text/javascript" src="https://d3s6yopk5rlhed.cloudfront.net/static/js/jquery.ui.js"></script>
<script type="text/javascript">
	$(function() {
		// Initial page to disabled edit
		var postData = JSON.parse(localStorage.getItem('postData'));
		$('.footer').css({'position':'relative'})
	});
	layui.use('form', function(){
	  	var form = layui.form;
	});


	function submit() {
		var is_accept = $('input[name=is_accept]:checked').val();
		console.log(is_accept);
		if(is_accept == 0){
			$('#isAccept-wrap').text('Please accept the terms and conditions');
			return false;
		}
		//console.log(postData);
		var postData = JSON.parse(localStorage.getItem('postData'));
		console.log(postData);
		
		$.ajax({
			url: '/save',
			data: postData,
			dataType: 'json',
			type: 'post',
			success: function(ret) {
				console.log(ret);
				if(ret.status == 1){
					window.location.href = '/success';
				}else{
					window.location.href = '/fail';
				}
				//alert('提交成功！');
			}
		});
	}
</script>
{% endblock %}